import {useEffect, useState} from "react";
import {getChannelsAPI} from "../apis/article.jsx";

function useChannel() {
    const [channelList, setChannelList] = useState([]);
    useEffect(() => {
        const getChannels = async () => {
            const res = await getChannelsAPI();
            setChannelList(res.data);
        };
        getChannels()
    },[])
    return {channelList}
}
export {useChannel};